// pages/goods/collect_list/collect_list.js
var app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    scrollListHeight: '',
    collectList: [],
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getCollectOptions();
  },

  loadMoreCollectList: function (e) {
    this.setData({
      collectList: e.detail.data
    })
  },

  viewGoods: function (e) {
    var targetId = e.detail.id;
    wx.navigateTo({
      url: '../../goods_detail/goods_detail?goods_id=' + targetId + '&group_id=' + 0,
    })
  },

  getCollectOptions: function () {
    var collectOptions = {
      list_id: 'collectList',
      url: '/api/index.php?app=account&act=my_favorite',
    }
    this.setData({
      scrollListHeight: app.globalData.pageHeight,
      collectOptions: collectOptions
    })
  },
})